<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="generator" content="ScreenSteps http://www.screensteps.com/" />
	<title>Setting up for user, roles and Resources for your system</title>
	<link href="../css/modern.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8" />
	<link href="../css/prettyPhoto.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8" />
	<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="../js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
		$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto({
			  show_title: false
			});
		});
  </script>
</head>

<body class="trebuchet">
	<div id="wrapper">		
		<div id="LessonContent">
			<div class="LessonHeader">
			  <p><a href="../nKnight.html">Back to Table of Contents</a></p>
				<h1 class="LessonTitle">Setting up for user, roles and Resources for your system</h1>
			</div>
			
			
				<div id="step_1" class="lessonStep top">
	        <h2 class="StepTitle">User Creation:</h2>
		<div class="image">
<img src="images/Setting_up_for_user__roles_and_Resources_for_your_system/usercrt.png" width="557" height="394" alt="" />
</div> <p>Operationally it is simple but the tricky part is that how to access this form. nKnight will do everything for you, if you have just written down the following lines of code, in your application. To give you an example you can insert this piece of code on a Menu Click event.</p>


<p><font color="#C00000">frmCreateUser frmCrtUsr = new frmCreateUser(dbl);</font> <font color="#00B050">//Create frmCreateUser object and send a datalayer object</font><br />
<font color="#C00000">frmCrtUsr.Show();</font></p>


<p>nKnight will throw an error if nKnight security layer or datalayer is not activated</p>
	</div>
	<div class="clear"></div>
	<div id="step_2" class="lessonStep top">
	        <h2 class="StepTitle">Role Creation:</h2>
		<div class="image">
<img src="images/Setting_up_for_user__roles_and_Resources_for_your_system/securitygroup.png" width="379" height="294" alt="" />
</div> <p>Again you have to write the following piece of code for accessing this form,</p>


<p><font color="#C00000">frmCreateSecurityGroups frmCrtSecuGrou = new frmCreateSecurityGroups(dbl); </font><font color="#00B050">//Create an object and send a datalayer object in the constructor.</font><br />
<font color="#C00000">frmCrtSecuGrou.Show();</font></p>
	</div>
	<div class="clear"></div>
	<div id="step_3" class="lessonStep top">
	        <h2 class="StepTitle">User-Role Mapping:</h2>
		<div class="image">
<img src="images/Setting_up_for_user__roles_and_Resources_for_your_system/user-role.png" width="415" height="381" alt="" />
</div> <p spacebelow="10">Again you have to create an object of<strong> the class &ldquo;</strong><font color="#C00000">frmAssignsSecurityGroup</font>&rdquo; and send datalayer object in the constructor.</p>
	</div>
	<div class="clear"></div>
	<div id="step_4" class="lessonStep top">
	        <h2 class="StepTitle">Resources used:</h2>
		<div class="image">
<img src="images/Setting_up_for_user__roles_and_Resources_for_your_system/resource.png" width="560" height="308" alt="" />
</div> <p>This will scan all your project forms and tell you every details about all the nKnight resources you have used. This is really interesting, right??? If you want to scan your project forms then you need to write the following piece of code,</p>


<p><font color="#C00000">string path = Application.ExecutablePath;</font><font color="#00B050">//Executable path</font><br />
<font color="#C00000">frmResources frmRe = new frmResources(dbl, path);</font> <font color="#00B050">//Constructor will take your application&rsquo;s executable path and again a datalayer object.</font><br />
<font color="#C00000">frmRe.Show(); </font></p>


<p>I don&rsquo;t want to give you a boring operational instruction like &ldquo;how to use it&rdquo; or &ldquo;after saving all those resources what will happen&rdquo;, because all those stuffs are cakewalk for you, isn't it? </p>
	</div>
	<div class="clear"></div>
	<div id="step_5" class="lessonStep top">
	        <h2 class="StepTitle">Role-Resource mapping:</h2>
		<div class="image">
<img src="images/Setting_up_for_user__roles_and_Resources_for_your_system/resource-role-map.png" width="560" height="238" alt="" />
</div> <p>This is the mapping form of roles with resources. The interesting part is that you don&rsquo;t need to write a single piece of code to access this form, only thing you have to do is to open resource list form and after pressing the save button, this form will open up automatically.</p>
	</div>
	<div class="clear"></div>

		</div>
		<div id="LessonPageNav">
		  <p></p>
		  <ul>
		    <li id="LessonPagePrevious"><a href="Adding_and_working_with_nKnightControls.html">Previous Page: Adding and working with nKnightControls</a> &nbsp;</li>
		    <li id="LessonPageCount">Page <strong>4</strong> of <strong>5</strong></li>
		    <li id="LessonPageNext"><a href="Give___Take.html">Next Page: Give &amp; Take</a> &nbsp;</li>
		    
		  </ul>
		</div>
	</div>	
</body>
</html>